/**
 * This Function returns 
 * @param {String} $Menu The Menu selektor of the Site menu.php
 * @returns {undefined}
 */
function getMenu($Menu){
    $.post("menu.php", {select_site:$Menu}, function(erg) {
      $("#Menu").html(erg); });
}

function getContent($Content){
    getMenu($Content);
    
    switch ($Content){
        case "Home":
            getSiteHome();
            break;
        
        case "Adressen":
            getSiteAdressen();
            break;
            
        case "Mailversand":
            getSiteMailversand();
            break;
            
        case "Administration":
            getSiteAdministration();
            break;
    }
}

/**
 * This Method displays an Alert in Bootstrap format
 * @param {String} al The Alert text
 * @param {String} anz Number of Alerts
 * @param {String} cont Where the Alert should be displayed
 */
function getAlert(al, anz, cont){
    
    if(cont === undefined){
        cont = 'alerts';
    }
    
    if(anz === undefined){
        
        var back = '';

            for(var i = 0; i < anz; i++){
                var ret = "<div class=\"alert alert-danger alert-dismissable\">";
                ret += "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>";
                ret += al[i];
                ret += "</div>";

                back += ret;

            }
        document.getElementById(cont).innerHTML = back;
    }else{
        var ret = "<div class=\"alert alert-danger alert-dismissable\">";
                ret += "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>";
                ret += al;
                ret += "</div>";

                
        document.getElementById(cont).innerHTML = ret;        
    }
}